<%@ page import="lf.day0109.lottery.dao.LotteryDao" %>
<%@ page import="lf.day0109.lottery.impl.LotteryDaoImpl" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="lf.day0109.lottery.entity.User" %>
<%@ page import="java.util.List" %>
<%@ page import="lf.day0109.travel.dao.TravelDao" %>
<%@ page import="lf.day0109.travel.impl.TravelDaoImpl" %>
<%@ page import="lf.day0109.travel.entity.Route" %><%--
  Created by IntelliJ IDEA.
  User: 19256
  Date: 2023/1/9
  Time: 23:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8" />
    <title>青游旅游社服务平台</title>
    <link rel="stylesheet" type="text/css" href="../../../css/lf/travel/tour.css" />
    <script type="text/javascript" src="../../../js/lf/travel/jquery-3.6.3.js"></script>
    <script type="text/javascript" src="../../../js/lf/travel/user.js"></script>
    <%
        //jsp组成部分: jsp小脚本  内置对象(9个内置对象)  jsp指令
        /*在jsp页面中获取后端Java程序,进行数据交互*/
        //1.使用多态体现,创建实例化LotteryDao数据访问层
        TravelDao travelDao = new TravelDaoImpl();
        //2.创建Map,,用来存储查询列表的搜索条件参数
        Map<String,Object> map = new HashMap<>();
        //3.调用查询列表方法
        List<Route> routeLists = travelDao.selectRouteAll(map);

    %>
    <script type="javascript">
        var arrStatus = new Array("自由行","纯玩团");
    </script>
</head>
<body>
<div class="container">
    <div class="top">
        <h1>青游旅游社服务平台</h1>
    </div>
    <div class="right">
        <button onclick="location.href='add.jsp'">添加</button>
    </div>
    <div class="middle">

        <div class="main">
            <ul>
                <li>旅游线路名称</li>
                <li>类型</li>
                <li>价格(元)</li>
                <li>咨询电话</li>
                <li>咨询人</li>
                <li>创建日期</li>
                <li>操作</li>
            </ul>
        </div>
        <div class="con">
            <form method="post" action="deleteController.jsp">
                <%
                    for (int i = 0; i < routeLists.size(); i++) {
                        String type = routeLists.get(i).getType();
                        if ("1".equals(type)) {
                            type = "自由行";
                        } else {
                            type = "纯玩团";
                        }
                %>
                <ul>
                    <li><%=routeLists.get(i).getTrName()%></li>
                    <li><%=type%></li>
                    <li><%=routeLists.get(i).getPrice()%></li>
                    <li><%=routeLists.get(i).getPhone()%></li>
                    <li><%=routeLists.get(i).getUser()%></li>
                    <li><%=routeLists.get(i).getCreateTime()%></li>
                    <li>
                        <a href="javascript:void(0);">详情</a>&nbsp;&nbsp;
                        <a href="javascript:void(0);" class="del">删除</a>
                    </li>
                </ul>
                <%
                    }
                %>
            </form>
        </div>
    </div>
</div>
</body>
</html>
